from dataclasses import dataclass
from typing import Self

@dataclass
class Stat:
    damage: int = 0
    health: int = 0
    defense: int = 0
    strength: int = 0
    intelligence: int = 0
    critChance: float = 0
    critDamage: float = 0
    bonusAttackSpeed: float = 0
    bonusAbilityDamage: float = 0
    bonusSpeed: float = 0
    luck: float = 0
    
    def __add__(self, other: Self) -> Self:
        return self.__class__(
            damage = self.damage + other.damage,
            health = self.health + other.health,
            defense = self.defense + other.defense,
            strength = self.strength + other.strength,
            intelligence = self.intelligence + other.intelligence,
            critChance = self.critChance + other.critChance,
            critDamage = self.critDamage + other.critDamage,
            bonusAttackSpeed = self.bonusAttackSpeed + other.bonusAttackSpeed,
            bonusAbilityDamage = self.bonusAbilityDamage + other.bonusAbilityDamage,
            bonusSpeed = self.bonusSpeed + other.bonusSpeed,
            luck = self.luck + other.luck
        )
    
    def __sub__(self, other: Self) -> Self:
        return self.__class__(
            damage = self.damage - other.damage,
            health = self.health - other.health,
            defense = self.defense - other.defense,
            strength = self.strength - other.strength,
            intelligence = self.intelligence - other.intelligence,
            critChance = self.critChance - other.critChance,
            critDamage = self.critDamage - other.critDamage,
            bonusAttackSpeed = self.bonusAttackSpeed - other.bonusAttackSpeed,
            bonusAbilityDamage = self.bonusAbilityDamage - other.bonusAbilityDamage,
            bonusSpeed = self.bonusSpeed - other.bonusSpeed,
            luck = self.luck - other.luck
        )
        
    @property
    def maxMana(self) -> int:
        return self.intelligence
    
    @property
    def manaRegen(self) -> int:
        return self.intelligence // 50
    